<template>
  <div class="p-4 space-y-4">
    <div class="text-xl font-bold text-blue-700 mb-2">toFixedAmount</div>
    <div class="text-gray-700 mb-2">将金额保留指定位数的小数（不加千分位）。</div>
    <div class="bg-white rounded-xl p-4 shadow">
      <div class="font-bold mb-2 text-blue-600">用法</div>
      <pre class="bg-blue-50 rounded p-3 text-sm text-blue-700 overflow-x-auto">
toFixedAmount('1234.567', 2)
toFixedAmount(1000, 0)
toFixedAmount('abc')</pre
      >
    </div>
    <div class="bg-white rounded-xl p-4 shadow">
      <div class="font-bold mb-2 text-green-600">示例1</div>
      <pre class="bg-green-50 rounded p-3 text-sm text-green-700 overflow-x-auto">
toFixedAmount('1234.567', 2) // '1234.57'</pre
      >
    </div>
    <div class="bg-white rounded-xl p-4 shadow">
      <div class="font-bold mb-2 text-green-600">示例2</div>
      <pre class="bg-green-50 rounded p-3 text-sm text-green-700 overflow-x-auto">
toFixedAmount(1000, 0) // '1000'</pre
      >
    </div>
    <div class="bg-white rounded-xl p-4 shadow border-l-4 border-blue-400">
      <div class="font-bold mb-2 text-gray-700">说明</div>
      <div class="text-xs text-gray-600 leading-relaxed">
        常用于金额展示，保留小数位但不加千分位。
      </div>
    </div>
  </div>
</template>
